import Vue from 'vue'
import VueRouter from 'vue-router'
import IndexView from "@/views/IndexView.vue";


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'index',
    component: IndexView,
    children:[
      {
        path: '/dept',
        name: 'dept',
        component: () => import(/* webpackChunkName: "about" */ '../views/DeptView.vue')
      },
      {
        path: '/role',
        name: 'role',
        component: () => import('../views/RoleView.vue')
      },
      {
        path: '/menu',
        name: 'menu',
        component: () => import(/* webpackChunkName: "about" */ '../views/MenuView.vue')
      },
      {
        path: '/user',
        name: 'user',
        component: () => import('../views/UserView.vue')
      },
      {
        path: '/post',
        name: 'post ',
        component: () => import('../views/PostView.vue')
      },
      {
        path: '/barChart',
        name: 'barChart ',
        component: () => import('../views/UserBarChartView.vue')
      },
      {
        path: '/Dict',
        name: 'Dict',
        component: () => import('../views/DictDataView.vue')
      },
      {
        path: '/DictType',
        name: 'DictType',
        component: () => import('../views/DictTypeView.vue')
      },
      {
        path: '/argpFactory',
        name: 'argpFactory',
        component: () => import('../views/ArgpFactoryView.vue')
      }
      ,
      {
        path: '/ArgpCrops',
        name: 'ArgpCtops',
        component: () => import('../views/ArgpCropsView.vue')
      },
      {
        path: '/machiningtask',
        name: 'machiningtask',
        component: () => import('../views/MachiningTaskView.vue')
      },
      {
        path: '/retailers',
        name: 'retailers',
        component: () => import('../views/RetailersView.vue')
      },
      {
        path: '/logistics',
        name: 'logistics',
        component: () => import('../views/LogisticsView.vue')
      },
      {
        path: '/data',
        name: 'data',
        component: () => import('../views/DataView.vue')
      }  ,
      {
        path: '/ArgpCropsGrowth',
        name: 'ArgpCropsGrowth',
        component: () => import('../views/ArgpGropsGrowthView.vue')
      },
      {
        path: '/leaves',
        name: 'leaves',
        component: () => import('../views/LeavesView.vue')
      },
      {
        path: '/argpholiday',
        name: 'argpholiday',
        component: () => import('../views/ArgpHolidayView.vue')
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/LoginView.vue')
  },
  {
    path: '/',
    name: 'factoryUser',
    component: () => import('../views/FactoryUserView.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
